Dashboard creation

Undercurrent uses Grafana for analytics dashboards. You run it yourself, and the image arrives with a SQL data source already connected to your events. You can build dashboards by hand, but this work is well suited to an AI coding harness.

Delegating to an AI harness

Paste this prompt into your coding harness in your app repo. It reads your app’s analytics events from the source code, designs dashboards, and creates them over the Grafana HTTP API.

Because Grafana runs on your machine, the harness talks to http://localhost:3000 directly. It needs your admin password, and nothing else — there is no API token to issue or store.

What it covers

The prompt directs your AI harness to design panels around the three groups of metrics that matter most for a growing app:

  • Activation: Are new users reaching the point where the app becomes useful?
  • Engagement: Which features and screens are used, and how often?
  • Retention: Are users coming back over time, and to which features?

It prefers a small number of dashboards (ideally one), smoke-tests every panel query against your live data, and then it should give you links to the dashboards it created.

The panel queries are written in SQL against your events table. See SQL queries for the schema and dialect.

Viewing and editing dashboards

Go to localhost:3000 and sign in. From there you can browse the dashboards, tweak panels, or build new ones directly. You can always ask your AI coding harness to edit the dashboards or create new ones by including the following prompt fragment:

Keeping dashboards in your repo

Your dashboards live in a Docker volume on the machine running Grafana. That makes them easy to lose and hard to share, so export the ones you care about and commit them:

curl -su admin:<your password> http://localhost:3000/api/search?type=dash-db
curl -su admin:<your password> http://localhost:3000/api/dashboards/uid/<uid> \
  > dashboards/<name>.json

Ask your harness to do this as a final step. You then get dashboards-as-code: reviewed in pull requests alongside the features they measure, and re-importable on any machine.

← Back to undercurrentanalytics.dev